package com.ljf.tijian.controller;

import com.ljf.tijian.ApiResponse;
import com.ljf.tijian.pojo.Hospital;
import com.ljf.tijian.service.HospitalService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class HospitalController {

    @Autowired
    HospitalService hospitalService;

    @RequestMapping("/listAllHospital")
    public ApiResponse listAllHospital(){

        return hospitalService.listAll();
    }

    @RequestMapping("/getHospitalById")
    public ApiResponse getHospitalById(@RequestBody Hospital hospital){
        return hospitalService.getHospitalById(hospital);
    }
}
